import request from '@/utils/request'
import Qs from 'qs'


export function userLogin(data) {
    return request({
        url: '/auth/login',
        method: 'post',
        data
    })
}


export function getUserDetails() {
    return request({
        url: '/auth/getUserDetails',
        method: 'get',
    })
}


export function getUserList(reqData) {
    return request({
        url: '/account/page',
        method: 'post',
        data: Qs.stringify(reqData),
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}

//添加用户
export function userCreate(reqData) {
    return request({
        url: '/account/create',
        method: 'post',
        data: Qs.stringify(reqData),
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}

//更新用户
export function userUpdate(reqData) {
    return request({
        url: '/account/update',
        method: 'post',
        data: Qs.stringify(reqData),
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}


//更新用户
export function userDelete(id) {
    return request({
        url: '/account/delete'+"?id="+id,
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}